<template>
  <div class="sub" :style="`width: ${wd};height:${he}`">
    <div class="sub-title">
      <div class="sub-title-left">
        <img src="../../../assets/img/decisionAnalysis/sub_arrow.png" alt="" />
        <span class="title">{{ title }}</span>
      </div>
      <div class="sub-title-right">
        <div class="is-mutiple" v-if="isMutiple">
          <span
class="num mutiple-one"
:style="`color: ${themeOne}`"
            >{{ num[0] }}/</span
          >
          <span class="num mutiple-two" :style="`color: ${themeTwo}`">{{
            num[1]
          }}</span>
          <span class="unit">{{ unit }}</span>
        </div>
        <div v-else>
          <span
            style="`color: ${theme}`"
            class="num"
            :style="`color: ${themeOne}`"
            >{{ num[0] }}</span
          >
          <span class="unit">{{ unit }}</span>
        </div>
      </div>
    </div>
    <div class="line">
      <span class="yellow"></span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DafosiControlWebSubTitle',
  props: {
    // 标题文本
    title: {
      type: String,
      default: ''
    },
    // 宽度
    wd: {
      type: String,
      require: true,
      default: ''
    },
    // 高度
    he: {
      type: String,
      require: true,
      default: ''
    },
    // 标题数据
    num: {
      type: Array,
      default: () => []
    },
    // 标题单位
    unit: {
      type: String,
      default: ''
    },
    // 是否多个数据 格式 23/9
    isMutiple: {
      type: Boolean,
      default: false
    },
    // 字体主题色
    themeOne: {
      type: String,
      default: ''
    },
    themeTwo: {
      type: String,
      default: ''
    }
  },

  data() {
    return {};
  },

  mounted() {},

  methods: {}
};
</script>

<style lang="scss" scoped>
.sub {
  &-title {
    display: flex;
    justify-content: space-between;
    height: 1.5rem;
    box-sizing: border-box;
    &-left {
      align-self: flex-start !important;
      img {
        vertical-align: top;
        width: 1.1875rem;
        height: 0.9375rem;
      }
      .title {
        vertical-align: top;
        display: inline-block;
        font-size: 0.875rem;
        height: 0.875rem;
        line-height: 1;
        margin-left: 0.4375rem;
      }
    }
    &-right {
      height: 0.75rem;
      font-size: 0.75rem;
      line-height: 1;
      font-family: PingFang SC, PingFang SC-Regular;
      color: #a2a7ba;
      .num {
        font-size: 0.875rem;
        height: 0.875rem;
        line-height: 1;
        font-family: Agency FB, Agency FB-Bold;
        font-weight: 700;
      }
      .unit {
        margin-left: 0.375rem;
      }
    }
  }
  .line {
    height: 0.125rem;
    width: 100%;
    background-color: rgba(37, 47, 76, 0.8);
    position: relative;
    .yellow {
      position: absolute;
      display: inline-block;
      width: 1.3125rem;
      height: 100%;
      background-color: $yellow;
      top: 0;
      left: 0;
      border-radius: 0.25rem;
    }
  }
}
</style>
